package com.yingside.io.io;

import java.io.*;

public class TestBufferedReader {
    public static void main(String[] args) {
        Reader reader = null;
        Writer writer = null;
        BufferedReader br = null;
        BufferedWriter bw = null;
        PrintWriter pw = null;
        try {
            reader = new FileReader("Test2.java");
            writer = new FileWriter("images/TestJFram.java");
            br = new BufferedReader(reader);
            bw = new BufferedWriter(writer);
            pw = new PrintWriter(bw);

            String str = null;

            while ((str = br.readLine()) != null){
                pw.println(str);
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

            try {
                bw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
